<h3><a href="<?=site_url('adm/category')?>"><strong><?=$this->lang->line('Root')?> </strong></a>
<?php
for($i=count($category_path)-1;$i>=0;$i--){
	$category=$category_path[$i];
?>
&#8249;<a href="<?=site_url('adm/category/'.$category['id'])?>"><strong> <?=$category['name']?> </strong></a>
<?php	
} 
?>
</h3>
<br/>
<br/>
<br/>
<?php
if(isset($notification))
{ 
?>
<div class="notification <?=$notification['type']?> png_bg">
	<a></a><a href="#" class="close"><?=img(array('title'	=> 'Close this notification',
													'alt'	=> 'Close',
													'src'	=> 'resources/images/icons/cross_grey_small.png',
	))?></a>
	<div>
	<?=$notification['content']?>
	</div>
</div>
<?php 
}
?>
<div class="content-box"><!-- Bắt đầu phần nội dung -->
				<div class="content-box-header"> <!-- Tạo các tab -->
					
					<h3><?=$this->lang->line('CATEGORY')?></h3>
					<ul class="content-box-tabs"> 
						<li><a href="#tab1" class="<?=$view_list;?>"><?=$this->lang->line('SUB_CATEGORIES')?></a></li> <!-- href must be unique and match the id of target div -->
						<li><a href="#tab2" class="<?=$create_cat?>"><?=$this->lang->line('Create')?></a></li>
						<?php if($info['id']!=0){?><li><a href="#tab3" class="<?=$edit_cat?>">Edit</a></li><?php }?>
					</ul>					
					<div class="clear"></div>
					
				</div> <!--Kết thúc tạo tab -->
				
				<div class="content-box-content"> <!--  bắt đầu phần tạo nội dung tab -->
					
					<div class="tab-content" id="tab1"> 
						
						<table>
							
							<thead>
								<tr>
								   <th><?=$this->lang->line('CAT_NAME')?></th>
								   <th><?=$this->lang->line('Description')?></th>
								   <th><?=$this->lang->line('Action')?></th>
								</tr>
								
							</thead>
						 
							<tfoot>
								<tr>
									<td colspan="4">
										<div class="bulk-actions align-left">
											
											<!-- input type="submit" class="button" value="New topic" /-->
										</div> 
										<div class="clear"></div>
									</td>
								</tr>
							</tfoot>
						 
							<tbody>
							<?php
							if(isset($sub_categories))
							foreach($sub_categories->result_array() as $row):
							
							?>
								<tr>
									<td><a href="<?=site_url('adm/category/'. $row['id']);?>"><?=$row['name'];?></a></td>
									<td><?=$row['description']; ?></td>
									<td>
										<!-- Icons -->
										 <a href="<?=site_url('adm/category/'. $row['id']. '/update');?>" title="Edit"><img src="<?=base_url() ?>resources/images/icons/pencil.png" alt="Edit" /></a>
										 <a href="<?=site_url('adm/category/'. $info['id']. '/delete/' . $row['id']);?>" title="Delete"><img src="<?=base_url() ?>resources/images/icons/cross.png" alt="Delete" /></a> 
									</td>
								</tr>
							<?php
							endforeach;
							?>
							</tbody>
						</table>
					</div> <!-- End #tab1 -->
					<div class="tab-content" id="tab2">
						<?=form_open('adm/category/'.$info['id'].'/create')?>
							
							<fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
								<p class="column-left">
									<label><?=$this->lang->line('Category Name')?></label>
									<input class="text-input small-input" type="text" name="name" value="" /> <!-- Classes for input-notification: success, error, information, attention -->
									<input type="checkbox" name="leftmenu" value="1" /> <?=$this->lang->line('LEFT_MENU')?>
								</p>
								<p>
									<label><?=$this->lang->line('Description')?></label>
									<input class="text-input small-input" type="text" name="description" value="" /> <!-- Classes for input-notification: success, error, information, attention -->
								</p>
								<input type="hidden" name="pid" value="<?=$info['id'];?>" />
								<p>
									<input class="button" type="submit" value="Create" />
								</p>
								
							</fieldset>
							
							<div class="clear"></div><!-- End .clear -->
							
						</form>
					</div>
					<?php if($info['id']!=0){?>
					<div class="tab-content" id="tab3">
						<?=form_open('adm/category/'.$info['id'].'/update')?>
							
							<fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
								<p>
									<label>Category Name</label>
									<input class="text-input small-input" type="text" name="name" value="<?=$info['name']?>" /> <!-- Classes for input-notification: success, error, information, attention -->
									<input type="checkbox" name="leftmenu" value="1"<?php if($category['leftmenu']==1) echo ' checked="checked"';?>/> <?=$this->lang->line('LEFT_MENU')?>
								</p>
								
								<p>
									<label>Description</label>
									<input class="text-input small-input" type="text" name="description" value="<?=$info['description']?>" /> <!-- Classes for input-notification: success, error, information, attention -->
								</p>
								<input type="hidden" name="id" value="<?=$info['id']?>" />
								<input type="hidden" name="pid" value="<?=$info['pid'];?>" />
								<p>
									<input class="button" type="submit" value="Save" />
								<p>
								
							</fieldset>
							
							<div class="clear"></div><!-- End .clear -->
							
						</form>
					</div>
					<?php }?>
				</div> <!-- End .content-box-content -->
				
			</div> <!-- End .content-box -->
<div class="content-box">
	<div class="content-box-header">
		<h3><?=$this->lang->line('TOPICS')?></h3>
		
	</div>
	<div class="content-box-content">
					<div>
						<table>
							<thead>
								<tr>
									<th><?=$this->lang->line('Topic name')?></th>
									<th><?=$this->lang->line('SUMMARY')?>
									<th><?=$this->lang->line('Action')?></th>
								</tr>
							</thead>
							<tfoot>
								<tr>
									<td colspan="4">
										<div class="bulk-actions align-left">
											<a class="button" href="<?=site_url('adm/topic/'.$info['id'].'/create')?>"><?=$this->lang->line('New topic')?></a>
										</div>
										<div class="clear"></div>
									</td>
								</tr>
							</tfoot>
							<tbody>
							<?php foreach($topics->result_array() as $topic){?>
								<tr>
									<td><a href="<?=site_url('adm/topic/'.$topic['id'])?>"><?=$topic['title']?></a></td>
									<td><?=substr($topic['summary'],0,30) . '...'?>
									<td>
										<!-- Icons -->
										 <a href="<?=site_url('adm/topic/'. $topic['id']. '/update');?>" title="Edit"><img src="<?=base_url() ?>resources/images/icons/pencil.png" alt="Edit" /></a>
										 <a href="<?=site_url('adm/topic/'. $topic['id']. '/delete/');?>" title="Delete"><img src="<?=base_url() ?>resources/images/icons/cross.png" alt="Delete" /></a> 
									</td>
								</tr>
							<?php }?>
							</tbody>
						</table>
					</div> <!-- tạo xong 1 tab -->
	</div>
</div>